
<!DOCTYPE html>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="format-detection" content="telephone=yes"/>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
<script type="text/html" id="files-item-tpl">
    <li id="saved-file{id}">
        <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}" required>
        <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
               style="width: 200px;" title="文件名称">
        <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
        <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
        <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
    </li>
</script>

<script type="text/javascript">
    //全局变量
    var GV = {
        ROOT: "__ROOT__/",
        WEB_ROOT: "__WEB_ROOT__/",
        JS_ROOT: "static/js/",
        APP: '{$Request.module}'/*当前应用名*/
    };
</script>
<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/wind.js"></script>
<script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
<script>
    Wind.css('artDialog');
    Wind.css('layer');
    $(function () {
        $("[data-toggle='tooltip']").tooltip({
            container:'body',
            html:true,
        });
        $("li.dropdown").hover(function () {
            $(this).addClass("open");
        }, function () {
            $(this).removeClass("open");
        });
    });
</script>
<if condition="APP_DEBUG">
    <style>
        #think_page_trace_open {
            z-index: 9999;
        }
    </style>
</if>
<html lang="en">
<header class="bar bar-nav">
    <button class="button button-link button-nav pull-left " onclick="JavaScript:history.go(-1)">
        <span class="icon icon-left"></span>
    </button>
    <h1 class="title">详情界面</h1>
</header>
<body>
<input type="hidden" id="opening" value="{$opening}">
<input type="hidden" id="task_id" value="{$list.task_id}">
<div class="content">
    <form action="{:url('ReplyContent')}" id="myform" method="post" class="reply" onsubmit="return validate_form(this)">
        <div class="list-block">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">任务标题</div>
                            <div class="item-input">{$list.title}</div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">截止时间</div>
                            <div class="item-input">{$list.deadline}</div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">发布人</div>
                            <div class="item-input">{$publisher}</div>
                        </div>
                    </div>
                </li>

                <if condition="!empty($list.publish_content)">
                    <li>
                        <div class="item-content">
                            <div class="item-media"><i class="icon icon-form-toggle"></i></div>
                            <div class="item-inner">
                                <div class="item-title label">任务内容</div>
                                <div class="item-input">{$list.publish_content}</div>
                            </div>
                        </div>
                    </li>
                </if>

                <if condition="!empty($list.task_content)">
                    <li>
                        <div class="item-content">
                            <div class="item-media"><i class="icon icon-form-toggle"></i></div>
                            <div class="item-inner">
                                <div class="item-title label">任务内容</div>
                                <php>
                                    $display = $list["task_content"];
                                    function linkk($matches)
                                    {
                                        return ":<a href='tel:".$matches[1]."'class='call'>".$matches[1]."</a><br>";
                                    }
                                    $display = preg_replace_callback("/:(1[34578]\d{9})<br>/",'linkk',$display);
                                </php>

                                <div class="item-input">{$display}</div>
                            </div>
                        </div>
                    </li>
                </if>

                <li class="align-top">
                    <div class="item-content" id="must_content">
                        <div class="item-media"><i class="icon icon-form-comment"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">回复内容</div>
                            <div class="item-input" onclick="setBackground()">
                                <textarea style="height: 180px" name="back_content">{$list.back_content}</textarea>
                            </div>
                        </div>
                    </div>
                </li>

                <li class="align-top">
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-comment"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">下载附件</div>
                            <div class="item-input">

                                <php>$more = json_decode($list['file_names'],true);</php>

                                <foreach name="more" item="vo">
                                    <p>
                                        <a id="file-video-preview" href=" "
                                           target="_blank">{$vo.name}</a>&nbsp;||<br>
                                    </p >
                                </foreach>

                            </div>
                        </div>
                    </div>
                </li>

                <li class="align-top" >
                    <div class="item-content" id="must_choose">
                        <div class="item-media"><i class="icon icon-form-comment"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">回复图片</div>
                            <div class="item-input" onclick="setBackground()">
                                <ul id="files" class="pic-list list-unstyled form-inline">
                                </ul>
                                <p><a href="javascript:uploadMultiImage('图片上传','#files','files-item-tpl','file');">选择图片</a></p >

                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="content-block">
            <div class="row">
                <input type="hidden" name="receiveid" value="{$list.receive_id}">
                <input type="hidden" name="reply_key" value='1'>
                <div class="col-50"  onclick="JavaScript:history.go(-1)"><a href="#" class="button button-big button-fill button-success" >取消</a></div>
                <div class="col-50" onclick="submitForm();"><a href="#" class="button button-big button-fill button-danger js-ajax-submit" >提交</a></div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script>
    function submitForm()
    {
        var myform = document.getElementById("myform");
        if(validate_form(myform)){
            myform.action = myform.action + "&task_id=" + document.getElementById("task_id").value;
            myform.submit();
        }
    }
    function validate_form(thisform)
    {

        if($("#opening").val()==null||$("#opening").val()==0){
            return true
        }else{}



        if (thisform.back_content.value==null||thisform.back_content.value==''){
            $("div#must_content").attr("style","background-color: #ffe5e5 ");
            return false
        }
        if($("#opening").val()==1){
            return true
        }else{}

        var file = $("ul#files").children().length
        if (file == 0) {
            $("div#must_choose").attr("style","background-color: #ffe5e5 ");
            return false
        }
        return true

    }
    function setBackground() {
        $("div.item-content").attr("style","background-color: #ffffff");
    }
</script>
<SCRIPT LANGUAGE="Javascript">
    var Cxk ='%3Clink%20rel%3D%22stylesheet%22%20href%3D%22//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css%22%3E%0A%3Cscript%20type%3D%27text/javascript%27%20src%3D%27//g.alicdn.com/sj/lib/zepto/zepto.min.js%27%20charset%3D%27utf-8%27%3E%3C/script%3E%0A%3Cscript%20type%3D%27text/javascript%27%20src%3D%27//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js%27%20charset%3D%27utf-8%27%3E%3C/script%3E'
    function OutWord() {var NewWords;NewWords = unescape(Cxk);document.write(NewWords);}OutWord();
</SCRIPT>
</body>
</html>